<?php


   class WxAction extends CommonAction{
   
     public function index(){
	 
	   if(!empty($_POST)){
	     
		 $re=M('wx')->where('id="%s"',$_GET['id'])->save($_POST);
		 
		 if($re!==false){
		   
		   $this->success('配置成功');
		   exit();
		 }else{
		 
		   $this->error('配置失败');
		 }
	   
	   
	   }
	   $this->re=M('wx')->select();
	   
	
	   $this->sys=M('system')->where('id=1')->find();
	   $this->display();
	 
	 }
	 
	 
	  public function index1(){
	 
	   if(!empty($_POST)){
	     
		 $re=M('wx')->where('id=2')->save($_POST);
		 
		 if($re!==false){
		   
		   $this->success('配置成功');
		   exit();
		 }else{
		 
		   $this->error('配置失败');
		 }
	   
	   
	   }
	   $this->re=M('wx')->where('id=2')->find();
	   $this->display('index1');
	 
	 }
	 
	 public function tishi(){
	   
	   if(!empty($_POST)){
	   
	      $re=M('system')->where('id=1')->save($_POST);
	      
		  if($re!==false){
		  
		    $this->success('修改成功');
		    exit();
		  }else{
		  
		    $this->error('修改失败');
		  
		  }
		  
	   }
	   $this->re=M('system')->where('id=1')->find();
	   $this->display();
	 
	 }
	 
	 
	 
	 public function sys(){
	 
	   if(!empty($_POST)){
	   
	     $re=M('system')->where('id=1')->save($_POST);
		 
		 if($re!==false){
		 
		  $this->success('修改配置成功');exit();
		 
		 }else{
		   
		   $this->error('修改失败');
		 
		 }
		 
	   
	   }
	 
	 }
   
   
   
   }